/*=============================================================================
#    The element-comm is a tentative program used to test our ideas.           
#                       Copyright (C)  bgao                                    
#
#     This program is free software; you can redistribute it and/or            
#      modify it under the terms of the GNU General Public License             
#     as published by the Free Software Foundation; either version 2           
#         of the License, or (at your option) any later version.               
#
#     This program is distributed in the hope that it will be useful,          
#    but WITHOUT ANY WARRANTY; without even the implied warranty of           
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            
#             GNU General Public License for more details.                    
#
#    You should have received a copy of the GNU General Public License        
#     along with this program; if not, write to the Free Software             
#      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,             
#                       MA  02110-1301, USA.                                  
#==============================================================================
# $Id: mac_assoc.h 348 2010-11-29 09:01:16Z bgao $ 
#
# $Author: bgao $ 
#
# $Revision: 348 $ 
#
# $Date: 2010-11-29 17:01:16 +0800 (星期一, 29 十一月 2010) $ 
#
# Description: 
#
=============================================================================*/
/*! @file mac_assoc.h
 *  @brief This is an interface for mac_assoc module
 */
#ifndef _MAC_ASSOC_H_
#define _MAC_ASSOC_H_

#include "common.h"
#include "buf.h"

/*! mac association request struct type definition */
typedef struct mac_assoc_req_t_ {
    uint8 handle;
    uint8 logic_chnl;
    uint8 chnl_page;
    uint16 coord_pan_id;
    addr_t coord;
    /* here, the bit-value is suited */
    uint8 cap_info;
    /* security related module is ignored */
} mac_assoc_req_t;

/*! mac association confirmation struct type definition */
typedef struct mac_assoc_cfm_t_ {
    addr_t addr;
    mac_status_t status;
} mac_assoc_cfm_t;

/*! mac association response struct type definition */
typedef struct mac_assoc_resp_t_ {
    uint8 handle;
    int64 dest_addr;
    int16 short_addr;
    mac_status_t status;
} mac_assoc_resp_t;

/*! mac communication status indication struct type definition */
typedef struct mac_comm_status_indict_t_ {
    uint16 pan_id;
    addr_t src_addr;
    addr_t dest_addr;
    mac_status_t status;
} mac_comm_status_indict_t; 

/*! mac association indication struct type definition */
typedef struct mac_assoc_indict_t_ {
    addr_t src;
    uint8 cap_info;
} mac_assoc_indict_t;

int8 mac_assoc_req(mac_assoc_req_t *req);
int8 mac_assoc_resp(mac_assoc_resp_t *resp);

#endif /* _MAC_ASSOC_H_ */
